<template>
  <div>
    <h1>post请求测试</h1>
    学号：<input type="text" v-model="stu_id" /><br />
    姓名：<input type="text" v-model="stu_name" /><br />
    语文：<input type="text" v-model="chinese" /><br />
    数学：<input type="text" v-model="math" /><br />
    英语：<input type="text" v-model="english" /><br />
    理综：<input type="text" v-model="lizong" /><br />
    文综：<input type="text" v-model="wenzong" /><br />
    <button @click="submit">提交数据</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      stu_id: "",
      stu_name: "",
      chinese: 0,
      math: 0,
      english: 0,
      lizong: 0,
      wenzong: 0,
    };
  },
  methods: {
    async submit() {
      // 提交数据  收集到数据之后向服务器提交
      let url = "entry_exam";
      let result = await this.$http.post(url, {
        stu_id: this.stu_id,
        stu_name: this.stu_name,
        chinese: this.chinese,
        math: this.math,
        english: this.english,
        lizong: this.lizong,
        wenzong: this.wenzong,
      });
      console.log(result);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>